package com.zhku.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhku.base.model.PageParams;
import com.zhku.base.model.PageResult;
import com.zhku.user.model.dto.ReturnShoppingCartDto;
import com.zhku.user.model.dto.ShoppingCartByNumDto;
import com.zhku.user.model.dto.ShoppingCartDto;
import com.zhku.user.model.po.TtUserShoppingcart;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author itcast
 * @since 2023-12-25
 */
public interface TtUserShoppingcartService extends IService<TtUserShoppingcart> {

    /**
     * 用户在购物车中添加商品
     * @param shoppingCartDto
     * @return
     */
    ReturnShoppingCartDto createShoppingcart(ShoppingCartDto shoppingCartDto);

    /**
     * 用户在购物车中删除商品
     * @param shoppingCartDto
     * @return
     */
    ReturnShoppingCartDto deleteShoppingcart(ShoppingCartDto shoppingCartDto);

    /**
     * 分页查询用户购物车中有哪些商品
     * @param pageParams
     * @param id
     * @return
     */
    PageResult<ReturnShoppingCartDto> getShopingcartList(PageParams pageParams, String id);

    /**
     * 支付成功后，从购物车中删除对应商品
     * @param userId
     * @param goodsId
     * @return
     */
    boolean deleteSuccessGoods(String userId, String goodsId);

    /**
     * 添加商品到购物车，指定了商品数量
     * @param shoppingCartByNumDto
     * @return
     */
    ReturnShoppingCartDto insertShoppingcartByNum(ShoppingCartByNumDto shoppingCartByNumDto);

    /**
     * 删除购物车中某个商品
     * @param shoppingCartDto
     */
    void dropShoppingcart(ShoppingCartDto shoppingCartDto);

}
